﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DTO;
using BUS;
using System.Collections.Generic;

namespace WebSieuThi.QuanLi.ThongKeAjax
{
    public partial class thongkesp : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int sp = int.Parse(Request.QueryString["sp"]);

            List<thongketheospResult> temp = new List<thongketheospResult>();
            temp = HangHoaBUS.LayDSTheoSP(sp);

            string str = "";
            str += "<table border=\"1\">"
    + "<tr><td>Mã hàng hóa</td><td>Tên hàng hóa</td><td>Số lượng</td><td>Đơn giá</td><td>Tổng giá trị</td><td>Ngày lập</td></tr>";

            for (int i = 0; i < temp.Count; ++i)
            {


                str += ""
    + "<tr><td>" + temp[i].mahh + "</td><td>" + temp[i].tenhanghoa + "</td><td>" + temp[i].soluong.ToString() + "</td>"
    + "<td>" + temp[i].dongia.ToString() + "</td><td>" + temp[i].tonggiatri.ToString() + "</td><td>" + temp[i].ngaylap.ToString() + "</td></tr>";
    


            }

            str += "</table>";


            Response.Write(str);

            
        }
    }
}
